cmake_minimum_required(VERSION 3.0)

project(OpenEXR)

set(HEADERS ${CMAKE_CURRENT_SOURCE_DIR} IlmImf Imath IexMath Iex Half IlmThread ${CMAKE_CURRENT_SOURCE_DIR}/../zlib/include ${CMAKE_CURRENT_SOURCE_DIR}/../../zlib/include ${CMAKE_CURRENT_SOURCE_DIR}/../../../zlib/include)

set(SOURCES 
		IexMath/IexMathFpu.cpp
		IlmImf/b44ExpLogTable.cpp
		IlmImf/ImfAcesFile.cpp
		IlmImf/ImfAttribute.cpp
		IlmImf/ImfB44Compressor.cpp
		IlmImf/ImfBoxAttribute.cpp
		IlmImf/ImfChannelList.cpp
		IlmImf/ImfChannelListAttribute.cpp
		IlmImf/ImfChromaticities.cpp
		IlmImf/ImfChromaticitiesAttribute.cpp
		IlmImf/ImfCompositeDeepScanLine.cpp
		IlmImf/ImfCompressionAttribute.cpp
		IlmImf/ImfCompressor.cpp
		IlmImf/ImfConvert.cpp
		IlmImf/ImfCRgbaFile.cpp
		IlmImf/ImfDeepCompositing.cpp
		IlmImf/ImfDeepFrameBuffer.cpp
		IlmImf/ImfDeepImageStateAttribute.cpp
		IlmImf/ImfDeepScanLineInputFile.cpp
		IlmImf/ImfDeepScanLineInputPart.cpp
		IlmImf/ImfDeepScanLineOutputFile.cpp
		IlmImf/ImfDeepScanLineOutputPart.cpp
		IlmImf/ImfDeepTiledInputFile.cpp
		IlmImf/ImfDeepTiledInputPart.cpp
		IlmImf/ImfDeepTiledOutputFile.cpp
		IlmImf/ImfDeepTiledOutputPart.cpp
		IlmImf/ImfDoubleAttribute.cpp
		IlmImf/ImfDwaCompressor.cpp
		IlmImf/ImfEnvmap.cpp
		IlmImf/ImfEnvmapAttribute.cpp
		IlmImf/ImfFastHuf.cpp
		IlmImf/ImfFloatAttribute.cpp
		IlmImf/ImfFloatVectorAttribute.cpp
		IlmImf/ImfFrameBuffer.cpp
		IlmImf/ImfFramesPerSecond.cpp
		IlmImf/ImfGenericInputFile.cpp
		IlmImf/ImfGenericOutputFile.cpp
		IlmImf/ImfHeader.cpp
		IlmImf/ImfHuf.cpp
		IlmImf/ImfInputFile.cpp
		IlmImf/ImfInputPart.cpp
		IlmImf/ImfInputPartData.cpp
		IlmImf/ImfIntAttribute.cpp
		IlmImf/ImfIO.cpp
		IlmImf/ImfKeyCode.cpp
		IlmImf/ImfKeyCodeAttribute.cpp
		IlmImf/ImfLineOrderAttribute.cpp
		IlmImf/ImfLut.cpp
		IlmImf/ImfMatrixAttribute.cpp
		IlmImf/ImfMisc.cpp
		IlmImf/ImfMultiPartInputFile.cpp
		IlmImf/ImfMultiPartOutputFile.cpp
		IlmImf/ImfMultiView.cpp
		IlmImf/ImfOpaqueAttribute.cpp
		IlmImf/ImfOutputFile.cpp
		IlmImf/ImfOutputPart.cpp
		IlmImf/ImfOutputPartData.cpp
		IlmImf/ImfPartType.cpp
		IlmImf/ImfPizCompressor.cpp
		IlmImf/ImfPreviewImage.cpp
		IlmImf/ImfPreviewImageAttribute.cpp
		IlmImf/ImfPxr24Compressor.cpp
		IlmImf/ImfRational.cpp
		IlmImf/ImfRationalAttribute.cpp
		IlmImf/ImfRgbaFile.cpp
		IlmImf/ImfRgbaYca.cpp
		IlmImf/ImfRle.cpp
		IlmImf/ImfRleCompressor.cpp
		IlmImf/ImfScanLineInputFile.cpp
		IlmImf/ImfStandardAttributes.cpp
		IlmImf/ImfStdIO.cpp
		IlmImf/ImfStringAttribute.cpp
		IlmImf/ImfStringVectorAttribute.cpp
		IlmImf/ImfSystemSpecific.cpp
		IlmImf/ImfTestFile.cpp
		IlmImf/ImfThreading.cpp
		IlmImf/ImfTileDescriptionAttribute.cpp
		IlmImf/ImfTiledInputFile.cpp
		IlmImf/ImfTiledInputPart.cpp
		IlmImf/ImfTiledMisc.cpp
		IlmImf/ImfTiledOutputFile.cpp
		IlmImf/ImfTiledOutputPart.cpp
		IlmImf/ImfTiledRgbaFile.cpp
		IlmImf/ImfTileOffsets.cpp
		IlmImf/ImfTimeCode.cpp
		IlmImf/ImfTimeCodeAttribute.cpp
		IlmImf/ImfVecAttribute.cpp
		IlmImf/ImfVersion.cpp
		IlmImf/ImfWav.cpp
		IlmImf/ImfZip.cpp
		IlmImf/ImfZipCompressor.cpp
		Imath/ImathBox.cpp
		Imath/ImathColorAlgo.cpp
		Imath/ImathFun.cpp
		Imath/ImathMatrixAlgo.cpp
		Imath/ImathRandom.cpp
		Imath/ImathShear.cpp
		Imath/ImathVec.cpp
		Iex/IexBaseExc.cpp
		Iex/IexThrowErrnoExc.cpp
		Half/half.cpp
		IlmThread/IlmThread.cpp
		IlmThread/IlmThreadMutex.cpp
		IlmThread/IlmThreadPool.cpp
		IlmThread/IlmThreadSemaphore.cpp
		IexMath/IexMathFloatExc.cpp
	)	
	
add_library(OpenEXR STATIC ${SOURCES})
target_include_directories(OpenEXR PUBLIC ${HEADERS})
target_link_libraries(OpenEXR)